<%inherit file="/base.html"/>

<%def name="main_heading()">${c.district}</%def>

<%def name="toolbar()">${h.select_district(c.district.id)}</%def>

<%def name="content()">
	<table class="data-table">
		<thead>
			<tr>
				<th rowspan="2">${_('Year')}</th>
				<th rowspan="2">${_('Month')}</th>
				% for cell in c.thead[0]:
				<% caption, colspan = cell %>
				<th colspan="${colspan}">${caption}</th>
				% endfor
			</tr>
			% for row in c.thead[1:]:
			<tr>
				% for cell in row:
				<% caption, colspan = cell %>
				<th colspan="${colspan}">${caption}</th>
				% endfor
			</tr>
			% endfor
		</thead>
		% for record in c.records:
		<tr class="${'weighty-record' if record.month == 13 else ''}">
			<td>${record.year}</td>
			<td>
				% if record.month == 13:
					${_('Total')}
				% else: 
					${h.month_name(record.month)}
				% endif
			</td>
			% for field in c.row(record):
			<td class="numeric">${field}</td>
			% endfor
		</tr>
		% endfor
	</table>
	<ul>
		<li><a href="${url.current(action='analysis', analytics='period', id=None)}">${_("Analysis for the period")}</a></li>
		<li><a href="${url.current(action='analysis', analytics='comparison', id=None)}">${_("Comparative analysis")}</a></li>
	</ul>
</%def>